.class public Lcom/a0soft/gphone/app2sd/main/PersistentToast;
.super Landroid/app/Service;
.source "PersistentToast.java"


# static fields
.field private static e:Ljava/lang/String;

.field private static f:Ljava/lang/String;

.field private static g:Ljava/lang/String;


# instance fields
.field private a:Landroid/view/WindowManager;

.field private b:Landroid/view/WindowManager$LayoutParams;

.field private c:Landroid/widget/RelativeLayout;

.field private d:Landroid/widget/TextView;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 28
    const-string v0, "sw"

    sput-object v0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->e:Ljava/lang/String;

    .line 29
    const-string v0, "txt"

    sput-object v0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->f:Ljava/lang/String;

    .line 31
    const-class v0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->g:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 22
    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    return-void
.end method

.method public static a(Landroid/content/Context;)V
    .locals 3
    .parameter

    .prologue
    .line 180
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/a0soft/gphone/app2sd/main/PersistentToast;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 181
    sget-object v1, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->e:Ljava/lang/String;

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 182
    invoke-virtual {p0, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 183
    return-void
.end method

.method public static a(Landroid/content/Context;Ljava/lang/String;)V
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 171
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/a0soft/gphone/app2sd/main/PersistentToast;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 172
    sget-object v1, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->e:Ljava/lang/String;

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 173
    sget-object v1, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->f:Ljava/lang/String;

    invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 174
    invoke-virtual {p0, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 175
    return-void
.end method

.method static synthetic a(Lcom/a0soft/gphone/app2sd/main/PersistentToast;)V
    .locals 0
    .parameter

    .prologue
    .line 22
    invoke-direct {p0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b()V

    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 3
    .parameter

    .prologue
    .line 131
    invoke-direct {p0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 143
    :goto_0
    return-void

    .line 137
    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->d:Landroid/widget/TextView;

    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 139
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->a:Landroid/view/WindowManager;

    iget-object v1, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    iget-object v2, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    invoke-interface {v0, v1, v2}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 140
    :catch_0
    move-exception v0

    .line 141
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "_Show(): exception="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    goto :goto_0
.end method

.method private a()Z
    .locals 1

    .prologue
    .line 119
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    invoke-virtual {v0}, Landroid/widget/RelativeLayout;->getWindowToken()Landroid/os/IBinder;

    move-result-object v0

    .line 122
    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private b()V
    .locals 3

    .prologue
    .line 148
    :try_start_0
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->a:Landroid/view/WindowManager;

    iget-object v1, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    invoke-interface {v0, v1}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 162
    :goto_0
    invoke-virtual {p0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->stopSelf()V

    .line 163
    return-void

    .line 158
    :catch_0
    move-exception v0

    .line 159
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "_Hide(): exception="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    goto :goto_0
.end method


# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 1
    .parameter

    .prologue
    .line 113
    const/4 v0, 0x0

    return-object v0
.end method

.method public onCreate()V
    .locals 5

    .prologue
    const/4 v4, 0x0

    const/4 v3, -0x2

    .line 36
    invoke-super {p0}, Landroid/app/Service;->onCreate()V

    .line 40
    const-string v0, "window"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    iput-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->a:Landroid/view/WindowManager;

    .line 42
    new-instance v0, Landroid/util/DisplayMetrics;

    invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V

    .line 43
    iget-object v1, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->a:Landroid/view/WindowManager;

    invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

    .line 45
    new-instance v0, Landroid/view/WindowManager$LayoutParams;

    invoke-direct {v0, v3, v3}, Landroid/view/WindowManager$LayoutParams;-><init>(II)V

    iput-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    .line 47
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    const/16 v1, 0x8

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    .line 48
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    const/high16 v2, 0x4

    or-int/2addr v1, v2

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    .line 49
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    or-int/lit16 v1, v1, 0x200

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

    .line 50
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    const/16 v1, 0x7d3

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->type:I

    .line 51
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    iput v3, v0, Landroid/view/WindowManager$LayoutParams;->width:I

    .line 52
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    iput v3, v0, Landroid/view/WindowManager$LayoutParams;->height:I

    .line 53
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    const/16 v1, 0x51

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->gravity:I

    .line 54
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    iput v3, v0, Landroid/view/WindowManager$LayoutParams;->format:I

    .line 55
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    iput-object v4, v0, Landroid/view/WindowManager$LayoutParams;->token:Landroid/os/IBinder;

    .line 56
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    const/4 v1, 0x0

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->x:I

    .line 57
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b:Landroid/view/WindowManager$LayoutParams;

    const/4 v1, 0x4

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->y:I

    .line 59
    invoke-static {p0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f030005

    invoke-virtual {v0, v1, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    iput-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    .line 61
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    new-instance v1, Landroid/view/ViewGroup$LayoutParams;

    invoke-direct {v1, v3, v3}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 63
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    const v1, 0x7f0a0004

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->d:Landroid/widget/TextView;

    .line 69
    iget-object v0, p0, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->c:Landroid/widget/RelativeLayout;

    const v1, 0x7f0a000c

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v1, Lcom/a0soft/gphone/app2sd/main/ad;

    invoke-direct {v1, p0}, Lcom/a0soft/gphone/app2sd/main/ad;-><init>(Lcom/a0soft/gphone/app2sd/main/PersistentToast;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 77
    return-void
.end method

.method public onStart(Landroid/content/Intent;I)V
    .locals 4
    .parameter
    .parameter

    .prologue
    .line 82
    invoke-super {p0, p1, p2}, Landroid/app/Service;->onStart(Landroid/content/Intent;I)V

    .line 84
    if-nez p1, :cond_0

    .line 85
    invoke-direct {p0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b()V

    .line 108
    :goto_0
    return-void

    .line 90
    :cond_0
    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 91
    if-nez v0, :cond_1

    .line 92
    invoke-direct {p0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b()V

    goto :goto_0

    .line 97
    :cond_1
    const/4 v1, 0x0

    .line 98
    sget-object v2, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->e:Ljava/lang/String;

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v3}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v2

    .line 99
    if-eqz v2, :cond_3

    .line 100
    sget-object v1, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->f:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 102
    :goto_1
    if-eqz v2, :cond_2

    .line 103
    invoke-direct {p0, v0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->a(Ljava/lang/String;)V

    goto :goto_0

    .line 106
    :cond_2
    invoke-direct {p0}, Lcom/a0soft/gphone/app2sd/main/PersistentToast;->b()V

    goto :goto_0

    :cond_3
    move-object v0, v1

    goto :goto_1
.end method
